const threeService = require('../services/threeService');

exports.getScene = (req, res) => {
  try {
    const scene = threeService.generateSimpleScene();
    res.json(scene);
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
};

exports.rotateModel = (req, res) => {
  try {
    const { modelData } = req.body;
    const { rotation } = req.body;
    
    if (!modelData || !rotation) {
      return res.status(400).json({ error: '缺少必要参数' });
    }
    
    const result = threeService.rotateModel(modelData, rotation);
    res.json(result);
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
};